<?php
/*
 *      _______ _     _       _     _____ __  __ ______
 *     |__   __| |   (_)     | |   / ____|  \/  |  ____|
 *        | |  | |__  _ _ __ | | _| |    | \  / | |__
 *        | |  | '_ \| | '_ \| |/ / |    | |\/| |  __|
 *        | |  | | | | | | | |   <| |____| |  | | |
 *        |_|  |_| |_|_|_| |_|_|\_\\_____|_|  |_|_|
 */
/*
 *     _________  ___  ___  ___  ________   ___  __    ________  _____ ______   ________
 *    |\___   ___\\  \|\  \|\  \|\   ___  \|\  \|\  \ |\   ____\|\   _ \  _   \|\  _____\
 *    \|___ \  \_\ \  \\\  \ \  \ \  \\ \  \ \  \/  /|\ \  \___|\ \  \\\__\ \  \ \  \__/
 *         \ \  \ \ \   __  \ \  \ \  \\ \  \ \   ___  \ \  \    \ \  \\|__| \  \ \   __\
 *          \ \  \ \ \  \ \  \ \  \ \  \\ \  \ \  \\ \  \ \  \____\ \  \    \ \  \ \  \_|
 *           \ \__\ \ \__\ \__\ \__\ \__\\ \__\ \__\\ \__\ \_______\ \__\    \ \__\ \__\
 *            \|__|  \|__|\|__|\|__|\|__| \|__|\|__| \|__|\|_______|\|__|     \|__|\|__|
 */
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2014 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: Dean <zxxjjforever@163.com>
// +----------------------------------------------------------------------
namespace Portal\Controller;
use Common\Controller\HomebaseController; 
/**
 * 首页
 */
class IndexController extends HomebaseController {

	public function index() {
        $m = M('nav');
        $where['parentid'] = 0;
        $status['status'] = 1;
        $arr = $m->where($where)->select();
        $this->assign('na',$arr);
    	$this->display(":index");
    }

    public function art()
    {   $id = I('get.sd');
        $this->assign('id',$id);
        $this->display(":articles");
    }

    //获取指定分类下的子分类
    public function type(){
        $id=I('param.sd');
        $e =I('param.gx');
        $su=I('param.su');
        $where['parent']=$id;
        $arr=M('terms')->order('term_id asc')->where($where)->limit(1)->select();
        $t=$arr[0]['term_id'];
        $su = !empty($su)?$su:1;
        $gt = !empty($e)?$e:$t;
        $this->assign('id',$id);
        $this->assign('gt',$gt);
        $this->assign('su',$su);
        echo $gt."<br/>";
        echo $su."<br/>";
        $this->display(":japan");

    }

    public function trip()
    {
        $this->display(":trips");
    }

    public function photo()
    {
        $this->display(":photos");
    }




}



